<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>动态切换图片边框</title>
  <style>
    .active{
      border: 5px solid blue;
      border-radius: 10px;
    }
  </style>
  <script src="vue3.js"></script>
</head>
<body>
  <div id="app">
    <h3 v-bind:title="title">切换图片边框</h3>
    <img v-bind:src="img" width="100" height="100" v-bind:class="{active:isActive}">
    <p v-bind:style="{ color: textColor, fontSize: fontSize + 'px' }">This is a paragraph.</p>
    <button @click="toggleActive">切换</button>
  </div>
  <script>
    const app = Vue.createApp({
      data() {
        return {
          title: "切换图片边框",
          img: "vvvvvv.png",
          textColor: 'red',
          fontSize: 16,
          isActive: false,
        }
      },
      methods:{
        toggleActive(){
          this.isActive=!this.isActive;
        }
      }
    }).mount("#app")
  </script>
</body>
</html>